package 抽象类作业;

import java.util.Scanner;

public class Shape {
    public static void main(String[] args) {
        Circle circle = new Circle();
        System.out.println("长方形周长是：  "+circle.area());
        Rectangle rectangle = new Rectangle();
        System.out.println("正方形周长是：  "+rectangle.area());
    }
}

abstract class mianji{
    public  abstract  int area();
}
class Circle  extends mianji {
    @Override
    public int area() {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入长方形的长");
        int chang = sc.nextInt();
        System.out.println("输入长方形的宽");
        int kuan = sc.nextInt();
        return chang * kuan;
    }
}

class Rectangle  extends mianji {
    @Override
    public int area() {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入正方形的长");
        int chang = sc.nextInt();
        System.out.println("输入正方形的宽");
        int kuan = sc.nextInt();
        return chang * kuan;
    }
}
